function updatePass() {
    let password1 = document.querySelector("#password1").value
    let password2 = document.querySelector("#password2").value
    let password3 = document.querySelector("#password3").value
    let id = JSON.parse(sessionStorage.getItem("userInfo")).mid
    let password = JSON.parse(sessionStorage.getItem("userInfo")).password
    // console.log(password1, password2, password3, id, password);
    if (!(password1 && password2 && password3)) {
        return alert("输入的内容不能为空")
    }
    if (password != password1) {
        return alert("原密码错误!")
    }
    if (password2 != password3) {
        return alert("确认新密码有误!")
    }
    Ajax({
        url: "http://localhost/Dorm%20Management/server/updatepassword.php",
        data: { id, password: password2 },
        success(msg) {
            alert("修改密码成功！")
            location.href = "http://localhost/Dorm%20Management/html/login.html"
        }
    })
}

